import os
from tkinter import filedialog
import tkinter as tk
def set_defau_dir():
    def set_save_path():
        global path2
        root = tkinter.Tk
        path2 = filedialog.askdirectory()
        print(fp)
    path1 = os.getcwd()
    path2 = path1 + "\images"
    var_set_path = tk.StringVar()
    open_dir=tk.Toplevel(width=400, height=100)
    open_dir.title("设置默认保存路径",)
    var_set_path.set( path2)
    set_dir = tk.Entry(open_dir, textvariable=var_set_path)
    set_dir.place( width=200, height=30, )
    set_save = tk.Button(open_dir, text="保存设置", command=set_save_path,).place(x=300,y=10)